home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / utilities / bmfc000.lha / BMFC / src / bmfc / parse.h < prev   
Encoding:
C/C++ Source or Header  |  1992-08-31  |  2.0 KB  |  61 lines

  1. /**************************************/
  2. /* parse.h                            */
  3. /* for BMFC 0.00                      */
  4. /* Copyright 1992 by Adam M. Costello */
  5. /**************************************/
  6.  
  7.  
  8. #include <stdio.h>
  9.  
  10.  
  11. void beginparsing(FILE *infile);
  12.  
  13. /* beginparsing(infile) must be called before any of   */
  14. /* the other functions are called.  This tells the     */
  15. /* other functions where to get their input, and also  */
  16. /* resets the current line number to 1 and the current */
  17. /* line position to 0.  beginparsing() may be called   */
  18. /* more than once, to parse more than one file.        */
  19.  
  20.  
  21. const unsigned char *nextword(void);
  22.  
  23. /* nextword() returns a string containing the next     */
  24. /* word in the instruction, or an empty string if      */
  25. /* there are no more words in the instruction.  The    */
  26. /* pointer returned is valid only until the next call  */
  27. /* to nextword().  See the file BMFC.doc, section      */
  28. /* SOURCE LANGUAGE, subsection Basic Syntax, for an    */
  29. /* explanation of words and instructions.              */
  30.  
  31.  
  32. int nextinstr(void);
  33.  
  34. /* nextinstr() advances to the next instruction, if    */
  35. /* there is one.  It returns 1 if there is one, 0 if   */
  36. /* there isn't (e.g., if end-of-file is reached.)      */
  37.  
  38.  
  39. int wordtoul(const unsigned char *word, unsigned long *ulptr);
  40.  
  41. /* wordtoul(word,ulptr) attempts to find the integer   */
  42. /* represented by word.  See the file BMFC.doc,        */
  43. /* section SOURCE LANGUAGE, subsection Basic Syntax,   */
  44. /* for an explanation of words than represent          */
  45. /* integers.  If wordtoul(word,ulptr) is able to find  */
  46. /* the integer, it writes the integer to *ulptr and    */
  47. /* returns 1, else it trashes *ulptr and returns 0.    */
  48.  
  49.  
  50. unsigned long linenum(void);
  51.  
  52. /* linenum() returns the line number of the last       */
  53. /* character read.  Lines are terminated by            */
  54. /* character $0A.                                      */
  55.  
  56.  
  57. unsigned long position(void);
  58.  
  59. /* position() returns the number of characters read so */
  60. /* far on the current line.                            */
  61.